package com.cloudpolice.equipment.unit;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;


@Component
@RefreshScope
public class GetPropertiesClass {
    @Value("${server.port}")
    private String port;
    @Value("${eureka.instance.metadata-map.version}")
    private String version;
    @Value("${spring.application.name}")
    private String springApplicationName;
    @Value("${liangHaoSign}")
    private String liangHaoSign;
    @Value("${send.Exception.Sign}")
    private String sendExceptionSign;
    @Value("${isAutoAgain}")
    private String isAutoAgainValue;

    public boolean getIsAutoAgain() {
        return isAutoAgainValue.equals("true") ? true : false;
    }

    public String getCreateFileFolder() {
        return "D:\\some";
    }

    /**
     * 是否发送异常
     *
     * @return
     */
    public boolean getSendException() {
        return sendExceptionSign.equals("1") ? true : false;
    }


    /**
     * 得到端口号
     *
     * @return
     */
    public String getPort() {
        return this.port;
    }

    /**
     * 得到版本
     *
     * @return
     */
    public String getVersion() {
        return this.version;
    }

    /**
     * 得到微服务名称
     *
     * @return
     */
    public String getApplicationName() {
        return this.springApplicationName;
    }

    /**
     * 自定义测试标识
     *
     * @return
     */
    public String getLiangHaoSign() {
        return this.liangHaoSign;
    }
}
